package boot.spring.po;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 订单表
 */
@Data
@EqualsAndHashCode()
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserAmount implements Serializable {
    // 订单
    private String ordersSn;

    // 内容
    private String body;

    // openid
    private String openid;

    // 金额
    private BigDecimal totalFee;

    // 支付类型
    private String tradeType;

    // 状态
    private String status;

    // 昵称
    private String nickname;

    // 头像
    private String headimhurl;

    private Integer page;
    private Integer fromIndex;
    private Integer pageSize;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
    private Date createTime;
    private String activityName;
    private String giftName;
    private BigDecimal amount;
    private Integer likes;
    private String time;
    private String username;
    private String timeAll;
    private String toUserName;

    public String getCreateTime(){
        return DateUtil.formatDateTime(createTime);
    }
}
